package com.zhijian.medical.entity.vo.response;

import com.zhijian.medical.enums.AssessmentPersonStatusEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author HCG
 * @version 1.0
 * @date 2023-02-09
 */
@Getter
@Api(tags = "我的考核回显vo")
@NoArgsConstructor
@AllArgsConstructor
public class MyAssessmentVo extends AssessmentVo implements Serializable {

    private static final long serialVersionUID = 1773234358881444849L;

    /**
     * 我的状态枚举值
     */
    @ApiModelProperty("我的状态枚举值")
    private Byte myStatus;

    /**
     * 我的状态字符串
     */
    @ApiModelProperty("我的状态字符串")
    private String myStatusStr;

    /**
     * 我的分数
     */
    @ApiModelProperty("我的分数")
    private Integer myScore;

    public void setMyScore(Integer myScore) {
        this.myScore = myScore;
    }

    public void setMyStatus(Byte myStatus) {
        this.myStatus = myStatus;
        if (Objects.isNull(this.myStatus)) {
            this.myStatusStr = null;
            return;
        }
        AssessmentPersonStatusEnum anEnum = AssessmentPersonStatusEnum.getByCode(Integer.valueOf(this.myStatus));
        this.myStatusStr = Objects.nonNull(anEnum) ? anEnum.getDesc() : null;
    }

    public void setMyStatusStr(String myStatusStr) {
        this.myStatusStr = myStatusStr;
    }
}
